home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / applications / wp / fcmacros.lha / OpenCGFonts < prev    next >
Text File  |  1994-03-02  |  2KB  |  67 lines

  1. /* $Id: $ */
  2. /**********************************************************************/
  3. /*
  4.  * Final Copy II Arexx Macro - OpenFonts
  5.  *
  6.  * Opens all fonts from several directories
  7.  * (see path definitions and patterns below)
  8.  *
  9.  * Requires: Final Copy II
  10.  * Author: Stefan Winterstein (winter@cs.uni-sb.de)
  11.  * Status: Public Domain
  12.  *
  13.  */
  14. /**********************************************************************/
  15. /*
  16.  * Here you can specify which fonts in which directories will be opened.
  17.  * Remember to adjust 'path.0' to the number of paths.
  18.  */
  19. /* path.1 = "CGFonts:~(#?bold#?|#?italic#?|#?fett#?|#?kursiv#?)#?.font" */
  20. path.1 = "CGFonts:#?.font"
  21. path.0 = 1                /* number of directories */
  22.  
  23. /**********************************************************************/
  24. OPTIONS RESULTS
  25. /*
  26.  * Create a sorted file containg all fonts we want to open
  27.  */
  28. fontfiles = ""
  29. DO i=1 FOR path.0
  30.    ADDRESS COMMAND 'List >ram:fontlist.error "'||path.i||'" FILES LFORMAT=%p%n TO RAM:fontlist.'||i
  31.    fontfiles = fontfiles "RAM:fontlist."||i
  32. END i
  33. ADDRESS COMMAND 'Join' fontfiles 'TO RAM:fontlist.unsorted'
  34. ADDRESS COMMAND 'Sort RAM:fontlist.unsorted TO RAM:fontlist'
  35.  
  36. /**********************************************************************/
  37. /*
  38.  * Read fontlist file into variable 'fontlist.'
  39.  */
  40. i = 0
  41. IF OPEN(.infile, "RAM:fontlist", "R") THEN DO
  42.    DO UNTIL EOF(.infile)
  43.      i = i +1
  44.      fontlist.i = READLN(.infile)
  45.    END
  46.    CALL CLOSE(.infile)
  47. END
  48. fontlist.0 = i-1
  49.  
  50. /* ADDRESS COMMAND 'Delete RAM:fontlist#?' */
  51.  
  52. /**********************************************************************/
  53. /*
  54.  * Open all fonts from 'fontlist.' in FinalCopy
  55.  */
  56. 'Status FontName'
  57. oldfont = RESULT
  58.  
  59. DO i=1 FOR fontlist.0
  60.    'Font' fontlist.i
  61. END i
  62.  
  63. 'Font' oldfont    /* reset old font */
  64.  
  65. /**********************************************************************/
  66. EXIT
  67.